<!-- 系统自动生成 Date:2021-06-11 10:29 -->
<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="【请填写功能名称】列表" bodyClass="gray-bg animated fadeInRight" isAnimation=false libs=["table","zTree","layout-latest"]/>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <@f.form id="classify-form" class="form-inline">
                <div class="select-list">
                    <ul>
                        <li>
                            <label> <@ctx.i18n text = "分类父级ID"/>：</label>
                            <@f.input placeholder="分类父级ID" name="parentId"/>
                        </li>
                        <li>
                            <label> <@ctx.i18n text = "分类封面地址"/>：</label>
                            <@f.input placeholder="分类封面地址" name="coverImage"/>
                        </li>
                        <li>
                            <label> <@ctx.i18n text = "分类名称"/>：</label>
                            <@f.input placeholder="分类名称" name="name"/>
                        </li>
                        <li>
                            <label> <@ctx.i18n text = "分类排序"/>：</label>
                            <@f.input placeholder="分类排序" name="sort"/>
                        </li>
                        <li>
                            <label> <@ctx.i18n text = "分类层级"/>：</label>
                            <@f.input placeholder="分类层级" name="level"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
                        </li>
                    </ul>
                </div>
            </@f.form>
        </div>
        <@table id="bootstrap-table">
            <@shiro.hasPermission name=":classify:add">
                <a class="btn btn-success" onclick=" opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
            </@shiro.hasPermission>
            <@shiro.hasPermission name=":classify:edit">
                <a class="btn btn-primary single disabled" onclick=" opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
            </@shiro.hasPermission>
            <@shiro.hasPermission name=":classify:del">
                <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()"><i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/></a>
            </@shiro.hasPermission>
        </@table>
    </div>
</div>
<@footer>
<script type="text/javascript">
    var editFlag = "${permission.hasPermi(":classify:edit")}";
    var listFlag = "${permission.hasPermi(":classify:add")}";
    var delFlag = "${permission.hasPermi(":classify:del")}";
    var visible = ${permission.isPermitteds(":classify:edit,:classify:del,:classify:add")?string('true', 'false')};
    var prefix = baseURL + "/classify";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "【请填写功能名称】",
            uniqueId:  'pkId',/* 唯一ID */
            escape: true,/* 分页设置 */
            showPageGo: true,/* 分页设置 */
            pageSize: 10,/* 分页设置 */
            pageList: [10, 30, 50],/* 分页设置 */
            columns:[
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }}
                ,{field : 'pkId',title : '<@ctx.i18n text = "数据主键"/>',visible: false}
                ,{field : 'parentId',title : '<@ctx.i18n text = "分类父级ID"/>'}
                ,{field : 'coverImage',title : '<@ctx.i18n text = "分类封面地址"/>'}
                ,{field : 'name',title : '<@ctx.i18n text = "分类名称"/>'}
                ,{field : 'sort',title : '<@ctx.i18n text = "分类排序"/>'}
                ,{field : 'level',title : '<@ctx.i18n text = "分类层级"/>'}
                ,{title:"<@ctx.i18n text = "操作"/>",align: 'center',visible:visible,formatter: function(value, row, index) {
                    var actions = [];
                    actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick=" opt.operate.edit(\'' + row.pkId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                    actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.pkId + '\')"><i class="fa fa-remove"></i>删除</a>');
                    return actions.join('');
                }}
            ]
        };
        $.table.init(options);
    });
</script>
</@footer>
</@pageTheme>